#include "ScriptPCH.h"

class Talent_Specialization : public CreatureScript
{
    public:
        Talent_Specialization() : CreatureScript("Talent_Specialization") { }
    

bool HasSpec(Player* pPlayer, uint32 talentID)
{
 TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentID);

    if (!talentInfo) // You gave me the wrong ID
        return false;

 uint32 points = 0;

 uint32 tTab = talentInfo->TalentTab;
    if (talentInfo->Row > 0)
    {
        uint32 numRows = sTalentStore.GetNumRows();
        for (uint32 i = 0; i < numRows; i++)          // Loop through all talents.
        {
            // Someday, someone needs to revamp
            const TalentEntry* tmpTalent = sTalentStore.LookupEntry(i);
            if (tmpTalent)                                  // the way talents are tracked
            {
                if (tmpTalent->TalentTab == tTab)
                {
                    for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++)
                    {
                        if (tmpTalent->RankID[rank] != 0)
                        {
                            if (pPlayer->HasSpell(tmpTalent->RankID[rank]))
                            {
                                points += (rank + 1);
                            }
                        }
                    }
                }
            }
        }
    }
 if (points > 5)
     return true;
         return false;

}
        

    bool OnGossipHello(Player * pPlayer, Creature * pCreature)
    {

        switch(pPlayer->getClass())
        {
            case CLASS_PALADIN:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a paladin. Paladins can perform all three possible roles of damage dealing, healing, or tanking.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cffE066FFRetribution|r specialization. This specialization focuses on damage dealing by applying additional holy damage to each attack.", GOSSIP_SENDER_MAIN, 0);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: The Art of War, Judgements of the Wise, and Pursuit of Justice.\nActives: Crusader Strike, Seal of Command and Exorcism", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cffFFFFFFHoly|r specialization. This specialization will make you a better healer, assisting your allies in combat.", GOSSIP_SENDER_MAIN, 1);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Illumination, Infusion of Light, and Holy guidance.\nActives: Holy shock, Cleanse, and Divine Illumination.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff2E37FEProtection|r specialization, used for tanking. It focuses around absorbing damage and keeping enemies in an area focused on hitting you.", GOSSIP_SENDER_MAIN, 2);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features: \nPassives: Spiritual Attunement, Rebout and Shield of the Templar. \nActives: Blessing of Santuary, Avenger's Shield and Hammer of the Righteous.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
            case CLASS_MAGE:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a mage. Mages may only fulfill the role of damage dealing, but they are notoriously good at doing so.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff1D7CF2Arcane|r specialization, which mainly relies on arcane magic and utility to defeat the enemy.", GOSSIP_SENDER_MAIN, 3);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassive: Arcane Mind, Arcane Empowerment and Missile Barrage.\nCounterspell and Arcane barrage.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cffB22222Fire|r specialization. Fire spec mages rely on mobility and destructive fire magic to burn their enemies to a crisp.", GOSSIP_SENDER_MAIN, 4);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Blazing Speed and Critical Mass\nActives: Blast Wave, Dragon's Breath, Living Bomb", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff0EBFE9Frost|r specialization. It is unique in the way that the mage may slow or even halt their enemy's progress while dealing signifigant damage.", GOSSIP_SENDER_MAIN, 5);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features: \nPassives: Shatter and Fingers of Frost\nActives: Ice Barrier, Iceblock, Deep Freeze.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
            case CLASS_WARRIOR:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a warrior. Warriors can perform well in both the role of a tank and a damage dealer.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff7B68EEArms|r specialization. Arms warriors typically use a two-handed weapon, pumping out massive damage slowly.", GOSSIP_SENDER_MAIN, 600);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Taste for Blood, Deep Wounds, Second Wind, Blood Frenzy (And a weapon specialization).\nActives: Mortal Strike", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff8B2500Fury|r specialization. Fury warriors would normally be found dual wielding one-handed weapons, attacking fast and strong.", GOSSIP_SENDER_MAIN, 7);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Flurry, Improved Berserker Stance, Bloodsurge.\nActives: Deathwish, Bloodthirst, and Slam", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff8B5742Protection|r specialization, used for tanking. It focuses around taking all the damage from your allies. You want to make sure all the enemies are attacking you when you're Protection spec.", GOSSIP_SENDER_MAIN, 8);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Damage Shield, Sword and Board, Vitality.\nActives: Shield Slam, Devastate, Vigilance.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
            case CLASS_PRIEST:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a priest. Priests may act as damage dealers by harming the soul and healers by soothing the spirit.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cffFFFFFFHoly|r specialization. This specialization will make you a better group healer, but a poor healer for individual people in need.", GOSSIP_SENDER_MAIN, 9);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Inspiration, Body and Soul, Spiritual Guidance.\nActives: Prayer of Mending and Guardian Spirit.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff78AB46Discipline|r specialization. It will increase your ability to heal, but mainly only good for strong heals on one target at a time.", GOSSIP_SENDER_MAIN, 10);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Divine Aegis, Focused Will, and Borrowed Time\nActives: Pain Surpression and Penance.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff757575Shadow|r specialization, which focuses on using shadow magic to defeat the enemy.", GOSSIP_SENDER_MAIN, 11);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Shadow Weaving and Shadow Power\nActives: Shadowform, Mind Flay, Devouring Plague.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
            case CLASS_HUNTER:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a hunter. Hunters have a vast array of utilities and excel in dealing damage by teaming up with a pet.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff800000Marksmanship|r specialization. This specialization focuses on the increasing your reliance on your gun, bow, or crossbow.", GOSSIP_SENDER_MAIN, 12);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features passives:\nWild quiver, Piercing Shots, and Improved Steady Shot.\nActives: Aimed shot and Steady shot", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff7BCC70Survival|r specialization. It will increase your ability to live through long and dangerous fights.", GOSSIP_SENDER_MAIN, 13);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Lock and Load and Survivalist\nactives: Feign Death, Frost Trap, Scatter shot.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff8A2BE2Beastmastery|r specialization. You will be able to manipulate your beasts into doing vast amounts of damage.", GOSSIP_SENDER_MAIN, 14);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Kindred Spirits, Frenzy, Serpents Swiftness\nActives: Beastial Wrath and The Beast Within", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
            case CLASS_ROGUE:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a rogue. Rogues specialize in being stealthy, dealing damage should they choose to reveal themselves.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff838EDESubtlety|r specialization. You will operate in the darkness, using your stealth as your greatest tool.", GOSSIP_SENDER_MAIN, 15);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Honor Among Thieves, Cheat Death, Slaughter from the Shadows\nActives: Shadowstep, Hemo, Vanish", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff8B3626Assassination|r specialization. Assassins typically deal great damage in short bursts and escape the scene.", GOSSIP_SENDER_MAIN, 16);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Overkill, Focused Attacks, Fleet Footed, Seal Fate, Deadly Brew\nActives: Mutilate.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff87CEEBCombat|r specialization. Though not the most traditional rogue spec, you will abandon your stealth-like nature to become a great damage dealer.", GOSSIP_SENDER_MAIN, 1700);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Lightning Reflexes, Combat Potency, Unfair Advantage (And either Dagger, Swords/Axes, or Mace spec).\nActives: Adrenaline Rush, Blade Flurry", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
            case CLASS_SHAMAN:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a shaman. Shamans are able to fulfill the roles of spell caster, melee damage dealer and healer, relying greatly on their totems.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff7BBF6ARestoration|r specialization. This specialization will make you a better healer, assisting your allies in combat.", GOSSIP_SENDER_MAIN, 18);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features Passives:\nAncestral Healing and Nature's Blessing\nActives: Earthshield, Nature's swiftness and EarthLiving Weapon.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cffD9D919Enhancement|r specialization. Those who follow this path typically dual wield one-handed weapons, relying on totems and bursty spells to take down the enemy.", GOSSIP_SENDER_MAIN, 19);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Flurry, Dual Wield, Maelstrom weapons\nActives: Stormstrike and Lavalash.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff912CEEElemental|r specialization. This specialization will increase the potency of your spells, making you a great damage dealer.", GOSSIP_SENDER_MAIN, 20);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Lightning Mastery, Lightning Overload, and Storm Earth and Fire\nActives: Chain Lightning, Thunderstorm.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
            case CLASS_WARLOCK:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a warlock. Warlocks use dark magic to corrupt their enemies and minions to do their dirty work.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff9CCB19Affliciton|r specialization, which consists of inflicting a great variety of curses on the enemy to take them down.", GOSSIP_SENDER_MAIN, 21);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features \nPassives: Pandemic, Death's Embrace, Nightfall, and Siphon Life.\nActives: Unstable Affliction.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cffA020F0Demonology|r specialization. Under this path, you will unlock the secret to increasing the power of your minions.", GOSSIP_SENDER_MAIN, 22);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives:Demonic Pact, Master Summoner, Demonic Knowledge.\nActives:Summon Felguard and Soul Link.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff9E0508Destruction|r specialization. Destruction warlocks wreak havoc, causing large amounts of damage with their long cast yet high damage spells.", GOSSIP_SENDER_MAIN, 23);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives:Backlash and Backdraft.\nActives:Shadowfury, Conflag, and Incinerate.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
            case CLASS_DRUID:
                pPlayer->ADD_GOSSIP_ITEM(7, "Greetings. You are a druid. A druid may fulfill all roles as spell caster, melee damage dealer, healer, and tank. Druids rely on their forms for survival.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cffE6E6FABalance|r specialization. The balance specialization focuses on using nature and arcane spells to destroy the enemy in the blink of an eye.", GOSSIP_SENDER_MAIN, 25);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Dreamstate, Earth and Moon, Eclipse, Nature's Splendor, Improved Faerie Fire\nActives: Moonkin Form.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff7BBF6ARestoration|r specialization. This specialization will make you a better healer, assisting your allies in combat.", GOSSIP_SENDER_MAIN, 26);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Nature's Bounty, Living Seed, Improved Barkskin\nActives: Wild Growth, Tree form, Swiftmend.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(3, "This is the |cff7B3F00Feral|r specialization, which focuses on dealing physical and over time damage in both bear and cat forms.", GOSSIP_SENDER_MAIN, 27);
                pPlayer->ADD_GOSSIP_ITEM(0, "This specialization features:\nPassives: Feral Swiftness, Leader of the Pack, Rend and Tear, Primal Gore\nActives: Feral Charge and Lacerate.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
                break;
        }
        return true;
    }
    
    bool OnGossipSelect(Player * pPlayer, Creature * creature, uint32 sender, uint32 uiAction)
    {
        uint32 ret[6] = {20375, 35395, 879, 53488, 26023, 31878}; //these are spellids for each class
        uint32 pprot[6] = {20911, 20135, 53711, 31935, 53595, 33776};// assuming you aren't a fuckass or cant read, this is pretty
        uint32 pholy[6] = {20215, 31842, 20473, 4987, 31841, 53576}; // obvious shit. 

        uint32 arcane[5] = {44425, 2139, 31583, 54490, 12503};
        uint32 fire[5] = {11368, 31642, 11113, 31661, 44457};
        uint32 frost[5] = {11426, 44572, 44545, 12983, 45438};

        uint32 arms[6] = {12294, 12849, 56638, 29838, 29859, 12712};
        uint32 fury[6] = {23881, 46915, 29763, 12974, 29801, 12292};
        uint32 protection[6] = {29144, 58874, 46953, 23922, 50720, 20243}; //in case you havent noticed, some trees have the same name so I switch em up a bit

        uint32 holy[5] = {15363, 15031, 64129, 33076, 47788};
        uint32 discipline[5] = {47515, 52800, 45244, 33206, 47540};
        uint32 shadow[5] = {15473, 2944, 15332, 15407, 33225};

        uint32 bm[5] = {19574, 34692, 19625, 56318, 34470};
        uint32 marksman[5] = {34120, 53224, 19434, 53217, 53238};
        uint32 survival[5] = {5384, 36732, 13809, 19259, 56344};

        uint32 elemental[5] = {51490, 421, 51486, 16582, 30679};
        uint32 enhancement[5] = {16284, 674, 51532, 17364, 60103};
        uint32 srestoration[5] = {974, 51730, 16188, 16240, 30869};

        uint32 affliction[5] = {47200, 58435, 63108, 18095, 30108};
        uint32 demonology[5] = {18710, 47240, 35693, 30146, 19028};
        uint32 destruction[5] = {17962, 34939, 47260, 30283, 29722};
        
        uint32 balance[6] = {60433, 33956, 48525, 33602, 24858, 57865};
        uint32 restoration[6] = {63411, 65139, 18562, 17078, 48438, 48500};
        uint32 feral[6] = {49377, 33917, 37117, 17007, 51269, 24866};

        uint32 assassin[6] = {31209, 58426, 51636, 14195, 1329, 51626};
        uint32 combat[6] = {13875, 51674, 13789, 35553, 13750, 13877};
        uint32 subtlety[6] = {16511, 31230, 1856, 51701, 36554, 51712};

        uint32 rweaponspec[3] = {13807, 13964, 13803}; //daggers, swords, maces in that order
        uint32 wweaponspec[3] = {12785, 12815, 12704}; //axe, sword, mace in that order

        if (sender == GOSSIP_SENDER_MAIN, 100)
        {
            pPlayer->PlayerTalkClass->ClearMenus();
            
            switch(uiAction)
            {
            case 100:
                OnGossipHello(pPlayer, creature);
            break;

                // Paladin
                case 0: //Retrubition
                    if (HasSpec(pPlayer, 1403))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(ret[i], false);
                            pPlayer->removeSpell(pholy[i], false, false);
                            pPlayer->removeSpell(pprot[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Retribution Tree!");
                    break;
                case 1: //Holy
                    if (HasSpec(pPlayer, 1432))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(pholy[i], false);
                            pPlayer->removeSpell(ret[i], false, false);
                            pPlayer->removeSpell(pprot[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Holy Tree!");
                    break;
                case 2:  //Protection
                    if (HasSpec(pPlayer, 1442))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(pprot[i], false);
                            pPlayer->removeSpell(ret[i], false, false);
                            pPlayer->removeSpell(pholy[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Protection Tree!");
                    break;
                
                // Mage
                case 3: // Arcane
                    if (HasSpec(pPlayer, 74))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(arcane[i], false);
                            pPlayer->removeSpell(fire[i], false, false);
                            pPlayer->removeSpell(frost[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Arcane Tree!");
                    break;

                case 4: // Fire
                    if (HasSpec(pPlayer, 27))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(fire[i], false);
                            pPlayer->removeSpell(frost[i], false, false);
                            pPlayer->removeSpell(arcane[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Fire Tree!");
                    break;

                case 5: // Frost
                    if (HasSpec(pPlayer, 38))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(arcane[i], false);
                            pPlayer->removeSpell(fire[i], false, false);
                            pPlayer->removeSpell(frost[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Frost Tree!");
                    break;
                    
                // Warrior


                case 7: // Fury
                    if (HasSpec(pPlayer, 2250))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(fury[i], false);
                            pPlayer->removeSpell(arms[i], false, false);
                            pPlayer->removeSpell(protection[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Fury Tree!");
                    break;
                case 8: // Protection
                    if (HasSpec(pPlayer, 142))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(protection[i], false);
                            pPlayer->removeSpell(arms[i], false, false);
                            pPlayer->removeSpell(fury[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Protection Tree!");
                    break;
                    
                // Priest
                case 9: // Holy
                    if (HasSpec(pPlayer, 410))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(holy[i], false);
                            pPlayer->removeSpell(discipline[i], false, false);
                            pPlayer->removeSpell(shadow[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Holy Tree!");
                    break;
                case 10: // Discipline
                    if (HasSpec(pPlayer, 342))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(discipline[i], false);
                            pPlayer->removeSpell(holy[i], false, false);
                            pPlayer->removeSpell(shadow[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Discipline Tree!");
                    break;
                case 11: // Shadow
                    if (HasSpec(pPlayer, 465))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(shadow[i], false);
                            pPlayer->removeSpell(discipline[i], false, false);
                            pPlayer->removeSpell(holy[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Shadow Tree!");
                    break;
                    
                // Hunter
                case 12: // Marksman
                    if (HasSpec(pPlayer, 1341))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(marksman[i], false);
                            pPlayer->removeSpell(survival[i], false, false);
                            pPlayer->removeSpell(bm[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Marksman Tree!");
                    break;
                case 13: // Survival
                    if (HasSpec(pPlayer, 1623))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(survival[i], false);
                            pPlayer->removeSpell(bm[i], false, false);
                            pPlayer->removeSpell(marksman[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Survival Tree!");
                    break;
                case 14: // Beastmaster
                    if (HasSpec(pPlayer, 1382))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(bm[i], false);
                            pPlayer->removeSpell(marksman[i], false, false);
                            pPlayer->removeSpell(survival[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Beastmastery Tree!");
                    break;
                    
                // Rogue
                case 15: //Sub
                    if (HasSpec(pPlayer, 2244))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(subtlety[i], false);
                            pPlayer->removeSpell(combat[i], false, false);
                            pPlayer->removeSpell(assassin[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Subtlety Tree!");
                    break;
                case 16: // Assassination
                    if (HasSpec(pPlayer, 276))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(assassin[i], false);
                            pPlayer->removeSpell(combat[i], false, false);
                            pPlayer->removeSpell(subtlety[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Assassination Tree!");
                    break;
                    
                // Shaman
                case 18: //Restoration
                    if (HasSpec(pPlayer, 586))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(srestoration[i], false);
                            pPlayer->removeSpell(enhancement[i], false, false);
                            pPlayer->removeSpell(elemental[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Restoration Tree!");
                    break;
                case 19: // Enhancement
                    if (HasSpec(pPlayer, 610))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(enhancement[i], false);
                            pPlayer->removeSpell(elemental[i], false, false);
                            pPlayer->removeSpell(srestoration[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Enhancement Tree!");
                    break;
                case 20: // Elemental
                    if (HasSpec(pPlayer, 564))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(elemental[i], false);
                            pPlayer->removeSpell(srestoration[i], false, false);
                            pPlayer->removeSpell(enhancement[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Elemental Tree!");
                    break;
                    
                // Warlock
                case 21: //Affliction
                    if (HasSpec(pPlayer, 1284))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(affliction[i], false);
                            pPlayer->removeSpell(demonology[i], false, false);
                            pPlayer->removeSpell(destruction[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Affliction Tree!");
                    break;
                case 22: // Demonology
                    if (HasSpec(pPlayer, 1221))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(demonology[i], false);
                            pPlayer->removeSpell(affliction[i], false, false);
                            pPlayer->removeSpell(destruction[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Demonology Tree!");
                    break;
                case 23: //Destruction
                    if (HasSpec(pPlayer, 944))
                    {
                        for (uint32 i = 0; i < 5; i++) 
                        {
                            pPlayer->learnSpell(destruction[i], false);
                            pPlayer->removeSpell(demonology[i], false, false);
                            pPlayer->removeSpell(affliction[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Destruction Tree!");
                    break;
                    
                // Druid
                case 25: // Balance
                    if (HasSpec(pPlayer, 783))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(balance[i], false);
                            pPlayer->removeSpell(feral[i], false, false);
                            pPlayer->removeSpell(restoration[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Balance Tree!");
                    break;
                case 26: //Restoration    
                    if (HasSpec(pPlayer, 824))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(restoration[i], false);
                            pPlayer->removeSpell(balance[i], false, false);
                            pPlayer->removeSpell(feral[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Restoration Tree!");
                    break;

                case 27: //Feral
                    if (HasSpec(pPlayer, 801))
                    {
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(feral[i], false);
                            pPlayer->removeSpell(balance[i], false, false);
                            pPlayer->removeSpell(restoration[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Feral Tree!");
                    break;

                case 600:
                pPlayer->ADD_GOSSIP_ITEM(0, "You may choose a weapon specialization talent.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(5, "Poleaxe Specialization: While wielding an Axe or Poleaxe you recieve +5% critical strike chance.", GOSSIP_SENDER_MAIN, 999);
                pPlayer->ADD_GOSSIP_ITEM(5, "Mace Specialization: While wielding a Mace you recieve +15% Armor Penetration.", GOSSIP_SENDER_MAIN, 998);
                pPlayer->ADD_GOSSIP_ITEM(5, "Sword Specialization: While wielding a sword you have a 10% chance to strike again.", GOSSIP_SENDER_MAIN, 997);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());
                break;

                case 999:
                if (HasSpec(pPlayer, 124))
                    {
                        pPlayer->learnSpell(wweaponspec[0], false);
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(arms[i], false);
                            pPlayer->removeSpell(fury[i], false, false);
                            pPlayer->removeSpell(protection[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Arms Tree!");
                    break;
                
                                    case 998:
                if (HasSpec(pPlayer, 124))
                    {
                        pPlayer->learnSpell(wweaponspec[2], false);
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(arms[i], false);
                            pPlayer->removeSpell(fury[i], false, false);
                            pPlayer->removeSpell(protection[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Arms Tree!");
                    break;


                                    case 997:
                if (HasSpec(pPlayer, 124))
                    {
                        pPlayer->learnSpell(wweaponspec[1], false);
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(arms[i], false);
                            pPlayer->removeSpell(fury[i], false, false);
                            pPlayer->removeSpell(protection[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Arms Tree!");
                    break;

                case 1700:
                pPlayer->ADD_GOSSIP_ITEM(0, "You may choose a weapon specialization talent.", GOSSIP_SENDER_MAIN, 100);
                pPlayer->ADD_GOSSIP_ITEM(5, "Close Quarters Combat: While wielding a Dagger or Fist Weapon you recieve +5% critical strike chance.", GOSSIP_SENDER_MAIN, 996);
                pPlayer->ADD_GOSSIP_ITEM(5, "Mace Specialization: While wielding a Mace you recieve +15% Armor Penetration.", GOSSIP_SENDER_MAIN, 995);
                pPlayer->ADD_GOSSIP_ITEM(5, "Hack and Slash: While wielding a Sword or Axe you have a 5% chance to strike again.", GOSSIP_SENDER_MAIN, 994);
                pPlayer->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());
                break;

                case 996:
                if (HasSpec(pPlayer, 203))
                    {
                        pPlayer->learnSpell(rweaponspec[0], false);
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(combat[i], false);
                            pPlayer->removeSpell(assassin[i], false, false);
                            pPlayer->removeSpell(subtlety[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Combat Tree!");
                    break;


                case 995:
                if (HasSpec(pPlayer, 203))
                    {
                        pPlayer->learnSpell(rweaponspec[2], false);
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(combat[i], false);
                            pPlayer->removeSpell(assassin[i], false, false);
                            pPlayer->removeSpell(subtlety[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Combat Tree!");
                    break;


                case 994:
                if (HasSpec(pPlayer, 203))
                    {
                        pPlayer->learnSpell(rweaponspec[1], false);
                        for (uint32 i = 0; i < 6; i++) 
                        {
                            pPlayer->learnSpell(combat[i], false);
                            pPlayer->removeSpell(assassin[i], false, false);
                            pPlayer->removeSpell(subtlety[i], false, false);
                        }
                    pPlayer->PlayDirectSound(3337);
                    pPlayer->CastSpell(pPlayer, 47292);
                    }
                    pPlayer->GetSession()->SendNotification("You do not have six (6) points in the Combat Tree!");
                    break;
            }
            pPlayer->CLOSE_GOSSIP_MENU();
        }
        return true;
    }
};

void AddSC_Talent_Specialization() 
{
    new Talent_Specialization();
}